package com.chen.user.controller;

import com.chen.model.vo.common.Result;
import com.chen.model.vo.common.ResultCodeEnum;
import com.chen.user.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cgj
 * @date 4/16/25 7:54 PM
 */
//http://localhost:8500/api/user/sms/sendCode/13171906822
@RequestMapping("/api/user/sms")
@RestController
public class SmsController {
    @Autowired
    private SmsService smsService;

    // 给指定手机号发送短信
    @GetMapping("/sendCode/{phone}")
    public Result sendCode(@PathVariable String phone){
        smsService.sendCode(phone);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
